home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
FROMUTS
/
GOFER
/
gofer_el
< prev
next >
Wrap
Lisp/Scheme
|
1991-11-20
|
2KB
|
54 lines
;;; Gofer mode for GNU Emacs
;;;
;;; Last update: 29/10/91
;;;
;;; Author: Stuart Clayman,
;;; Dept. Computer Science,
;;; University College London
;;;
;;; Email: sclayman@uk.ac.ucl.cs
;;;
;;;
;;; In the file .emacs put a line
;;; (autoload 'run-gofer "gofer" "Run gofer as inferior process" t)
;;;
;;; In emacs type ESC-x run-gofer
;;; In files that are gofer source type ESC-x gofer-mode
;;;
;;; To get the files to load into gofer type ESC C-x
;;;
(require 'shell)
(defvar gofer-mode-hook nil "Gofer mode hook")
(defun run-gofer()
"Run an inferior Gofer process."
(interactive)
(switch-to-buffer (make-shell "gofer" "gofer"))
(make-variable-buffer-local 'shell-prompt-pattern)
(setq shell-prompt-pattern "^[? ]*? \\|^"))
(defun save-gofer-buffer-and-go(arg)
"Save current Gofer file buffer.
Goto inferior Gofer buffer and load file.
With ARG make additional file"
(interactive "P")
(save-buffer)
(if (or (null (get-buffer "*gofer*")) (null (process-status "gofer"))) ; if gofer not running
(save-excursion (run-gofer))) ; run it
(if arg
(send-string "gofer" (concat ":a " (buffer-name) "\n")))
(send-string "gofer" (concat ":l " (buffer-name) "\n"))
(switch-to-buffer-other-window "*gofer*"))
(defun gofer-mode()
"Gofer mode."
(interactive)
(setq mode-name "Gofer")
(make-variable-buffer-local 'indent-line-function)
(setq indent-line-function 'indent-relative)
(run-hooks 'gofer-mode-hook)
(local-set-key "\e\C-x" 'save-gofer-buffer-and-go)
(local-set-key "\eg" 'goto-line))